﻿Imports Phila
Imports Phila.Sql
Imports Phila.CommonClasses

Public Class News
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            If Request.QueryString("id") Is Nothing Then
                plNews.Visible = True
                plNewsDetails.Visible = False
                Fill_dtList(dlNews, "select * from ptn_News order by UpdatedDate desc")
            Else
                plNews.Visible = False
                plNewsDetails.Visible = True
                Dim txt As Array
                Dim strData As New StringBuilder
                txt = RetriveData("select Id, Title, Date, Description from ptn_News where IsActive=1 and IsArchive=0", 3)
                strData.Append("<h2>" & txt(1) & "</h2>")
                strData.Append("<p class=""date"">" & txt(2) & "</p>")
                strData.Append(txt(3))
                ltrNewsDetals.Text = strData.ToString
            End If
        Catch ex As Exception
            Throw ex
        End Try
    End Sub

    Protected Function DateFormat(ByVal sDate As DateTime)
        Return DisplayDate(sDate)
    End Function

End Class